package com.zjp.mg.core;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ReflectUtil;
import org.springframework.stereotype.Service;

import java.lang.reflect.Field;
@Service
public class BaseService {


    protected final String COLL_NAME = "collName";

    protected final String SEQ_Id = "seqId";

    protected final String IS_DELETED = "isDeleted";
    protected final String ID = "_id";

    protected final int INCREMENT_VALUE = 1;


    public Field[] getAllField(Class<?> c) {
        if (FileUtil.isWindows()) {
            // 不使用缓存
            return ReflectUtil.getFieldsDirectly(c, true);
        } else {
            return ReflectUtil.getFields(c);
        }
    }
}